<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>

  <script src="./lib/vue.js"></script>
</body>

</html>
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="./lib/vue.js"></script>
</head>

<body>
  <div id="app">
    <!-- 失去焦点时，更新数据源 -->
    <!-- <input type="text" v-model.lazy="title"> -->
    <!-- 去两端空格 -->
    <!-- <input type="text" v-model.trim="title"> -->
    <!-- 转数字 -->
    <input type="text" v-model.number="n1"> +
    <input type="text" v-model.number="n2"> = {{n1+n2}}
  </div>

  <script>
    /* let n = 'a1'
    console.log(Number(n)) // NAN
    console.log(parseInt(n)) // NAN */

    /* let n = '1a'
    console.log(Number(n)) // NAN
    console.log(parseInt(n)) // 1 */

    /* let n = '1a'
    console.log(+n) // NaN */

    let vm = new Vue({
      el: '#app',
      data: {
        title: '',
        n1: 1,
        n2: 2
      }
    })
  </script>
</body>

</html>